import { BasicColumn, FormSchema } from '@/components/Table';
import { h, ref } from 'vue';
import { Tag } from 'ant-design-vue';
import {VxeFormItemProps, VxeGridPropTypes} from "@/components/VxeTable";


//表格列名
export const columns: BasicColumn[] = [
  {
    title: '用户名',
    dataIndex: 'userName',
    width: 130,

  },
  {
    title: '试卷名称',
    dataIndex: 'paperName',
  },
  {
    title: '得分',
    dataIndex: 'score',
    width: 130,
  },
  {
    title: '创建时间',
    width: 180,
    dataIndex: 'createTime',
  },
  {
    title: '交卷时间',
    width: 180,
    dataIndex: 'endTime',
  },

];


/**
 */
export const vxeTableColumns: VxeGridPropTypes.Columns = [
  {
    title: '用户名',
    field: 'userName',
    showOverflow: 'title',
    width: 130,

  },
  {
    title: '试卷名称',
    field: 'paperName',
    align: 'center',
  },
  {
    title: '得分',
    field: 'score',
    align: 'center',
    width: 90,
  },
  {
    title: '交卷时间',
    width: 180,
    field: 'endTime',
    align: 'center',
  },
  {
    title: '创建时间',
    field: 'createTime',
    width: 180,
    align: 'center',
  },
  {
    width: 150,
    title: '操作',
    align: 'center',
    field: '',
    slots: { default: 'action' },
    fixed: 'right',
  },
];


export const searchFormSchema: FormSchema[] = [
  {
    field: 'userName',
    label: '姓名',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'paperName',
    label: '试卷名称',
    component: 'Input',
    colProps: { span: 8 },
  },

];


export const vxeTableFormSchema: VxeFormItemProps[] = [
  {
    span: 5,
    field: 'userName',
    title: '姓名',
    itemRender: {
      props: {
        placeholder: '查询',
      },
      name: 'AInput',
    },
  },
  {
    span: 5,
    field: 'paperName',
    title: '试卷名称',
    itemRender: {
      props: {
        placeholder: '查询',
      },
      name: 'AInput',
    },
  },
  {
    span: 5,
    itemRender: {
      name: 'VxeButtonGroup',
      options: [
        { type: 'reset', content: '重置' },
        { type: 'submit', content: '查询', status: 'primary' },
      ],
    },
  },
];


export const formSchema: FormSchema[] = [
  {
    field: 'name',
    label: '团队名称',
    component:"Input",
    required: true,
  },
  {
    field: 'deptName',
    label: '部门名称',
    component:"Input",
    required: true,
  },
  {
    field: 'sort',
    label: '排序',
    component: 'InputNumber',
    required: true,
  },
  {
    field: 'trueScore',
    label: '得分',
    component: 'InputNumber',
  },
  {
    field: 'erroScore',
    label: '扣分',
    component: 'InputNumber',
  },
  {
    field: 'items',
    label: '成员',
    slot: 'items',
    colProps: { lg: 24, md: 24 },
  },

];



export const teamUserColumns: VxeGridPropTypes.Columns = [
  {
    title: '姓名',
    field: 'userName',
    showOverflow: 'title',
  },
  {
    width: 120,
    title: '操作',
    align: 'center',
    field: '',
    slots: { default: 'action' },
    fixed: 'right',
  },
  ]
